<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8">
    <title>Servlet</title>
    <link rel="stylesheet" href="/styles/index.css">
</head>
<body>

    <div class="wrapper">
        <p class="title">Hello Servlet</p>
        <section>
            <a href="/hello">/hello</a>
            <a href="/hello/servlet">/hello/servlet</a>
        </section>
    </div>

    <div class="wrapper">
        <p class="title">开发Servlet程序</p>
        <section>
            通过实现Servlet接口的方式开发Servlet程
            <ul>
                <li> <a href="/primitive">`/primitive`</a> </li>
                <li> <a href="/primitive/servlet">`/primitive/*`</a> </li>
                <li> <a href="/first">`/first`</a> </li>
                <li> <a href="/first/servlet">`/first/*`</a> </li>
            </ul>
        </section>
        <section>
            继承GenericServlet类并重写service方法
            <ul>
                <li> <a href="/primary">`/primary`</a> </li>
                <li> <a href="/primary/servlet">`/primary/*`</a> </li>
                <li> <a href="/second">`/second`</a> </li>
                <li> <a href="/second/servlet">`/second/*`</a> </li>
            </ul>
        </section>
        <section>
            继承HttpServlet类并重写doGet和doPost方法
            <ul>
                <li> <a href="/dispatcher">`/dispatcher`</a> </li>
                <li> <a href="/dispatcher/servlet">`/dispatcher/*`</a> </li>
                <li> <a href="/third">`/third`</a> </li>
                <li> <a href="/third/servlet">`/third/*`</a> </li>
            </ul>
            <form action="/dispatcher" method="get">
                用GET方式提交表单:
                <input type="text" name="username" value="kaifamiao">
                <input type="password" name="password">
                <button type="submit">提交</button>
            </form>
            <form action="/dispatcher" method="post">
                用POST方式提交表单:
                <input type="text" name="username" value="kaifamiao">
                <input type="password" name="password">
                <button type="submit">提交</button>
            </form>
        </section>
        <section>
            继承HttpServlet类并重写service(HttpServletRequest,HttpServletResponse)
            <ul>
                <li> <a href="/general">`/general`</a> </li>
                <li> <a href="/general?username=sanfeng&password=hello">`/general`</a> </li>
            </ul>
            <form action="/general" method="get">
                用GET方式提交表单:
                <input type="text" name="username" value="kaifamiao">
                <input type="password" name="password">
                <button type="submit">提交</button>
            </form>
            <form action="/general" method="post">
                用POST方式提交表单:
                <input type="text" name="username" value="kaifamiao">
                <input type="password" name="password">
                <button type="submit">提交</button>
            </form>
        </section>
    </div>

</body>
</html>